package com.diligent.cloud.sfc.resources;

import com.canny.commons.model.ListResult;
import com.canny.commons.model.ObjectResult;
import com.diligent.cloud.web.resource.IBaseResource;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.security.Principal;

/**
 * WorkShopExtrusionResource interface
 *
 * @author xf107278
 * @date 4/24/2020
 */
@RequestMapping("/sfc-work-shop-extrusion")
public interface WorkShopExtrusionResource extends IBaseResource {

    @GetMapping("/box-reported/filter")
    @ApiOperation(value = "车间现场/装框报数列表", notes = "车间现场/装框报数列表"  , tags = "车间现场")
    ResponseEntity<ListResult> boxReportedFilter( String machCode,String orderId,@RequestParam("isHanging") Boolean isHanging);

    @GetMapping("/use-box")
    @ApiOperation(value = "车间现场/使用容器", notes = "车间现场/使用容器"  , tags = "车间现场")
    ResponseEntity<ObjectResult> userBox(@RequestParam("boxId")Long boxId, @AuthenticationPrincipal Principal principal);

    @PostMapping("/cancel-use-box")
    @ApiOperation(value = "车间现场/取消使用容器", notes = "车间现场/取消使用容器"  , tags = "车间现场")
    ResponseEntity<ObjectResult> cancelUseBox(Long boxFillMasterId, @AuthenticationPrincipal Principal principal);

    @GetMapping("/mat-stock")
    @ApiOperation(value = "车间现场/查询物料库存", notes = "车间现场/查询物料库存"  , tags = "车间现场")
    ResponseEntity<ListResult> matStock(@RequestParam("machCode")String machCode, @RequestParam("type")String type ,@RequestParam("pageIndex")Long pageIndex, @RequestParam("pageSize")Long pageSize);


    @GetMapping("/warming-md/filter")
    @ApiOperation(value = "车间现场/模具加温列表", notes = "车间现场/模具加温列表"  , tags = "车间现场")
    ResponseEntity<ListResult> warmingMdFilter(@RequestParam("machCode")String machCode,@RequestParam("pageIndex") Long pageIndex,@RequestParam("pageSize") Long pageSize);

    @GetMapping("/as/filter")
    @ApiOperation(value = "车间现场/铝棒上机列表", notes = "车间现场/铝棒上机列表"  , tags = "车间现场")
    ResponseEntity<ListResult> upAsFilter(@RequestParam("machCode")String machCode,@RequestParam("pageIndex") Long pageIndex,@RequestParam("pageSize") Long pageSize);

    @PostMapping("/box-transport")
    @ApiOperation(value = "车间现场/查询扎号信息并且发起运输", notes = "车间现场/查询扎号信息并且发起运输"  , tags = "车间现场")
    ResponseEntity<ObjectResult> getLotsInfoAndInitiateTransport( String lotCode ,String location, Boolean enter,@AuthenticationPrincipal Principal principal);
}
